<template>
	<view class="stu_dangan">
		<view class="m_header">
			<changeOrgs @listData="listData" :bindType="bindType"></changeOrgs>
		</view>
		<view class="stu_content">
			<scroll-view :style="{height: height}" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" @scrolltolower="lower"
			@scroll="scroll">
				<view v-for="(ites, index) in qingList" :key="index">
					<view class="my_box1" v-for="(item, indexs) in ites.students" :key="indexs">
						<view class="j_b_box">
							<text class="m_title">{{item.empName}}档案</text>
							<view>
								<text class="jiebang" @click="jiebang(item)">{{name}}</text>
							</view>
						</view>
						<view class="m_info">
							<text class="m_txt">学&nbsp;&nbsp;&nbsp;校：<text class="m_txt1">{{item.orgName}}</text></text>
							<text class="m_txt">专&nbsp;&nbsp;&nbsp;业：<text class="m_txt1">{{item.deptName}}</text></text>
							<text class="m_txt">手机号：{{item.mobileNo == '' ? '暂无手机号' : item.mobileNo}}</text>
						</view>
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import changeOrgs from '../../components/changeOrgs.vue'
	export default {
		onShow: function(){
			let _that = this;
			uni.getSystemInfo({
				success: function (res) {
					_that.height = res.windowHeight - 120 + 'px';
				}
			})
		},
		onLoad:function(option){
			this.name = option.name
			this.bindType = option.bindType
		},
		data() {
			return {
				qingList: [],
				showAcount: -1,
				height: 0,
				orgId: '',
				bindType: 1,
				name: ''
			}
		},
		computed: {
			statusToTxt(status) {
				return function(status) {
					if(status == 0) {
						return "正常"
					} else if(status == 1) {
						return "已挂失"
					} else if(status == 2) {
						return "挂失已补办"
					}
				}
			}
		},
		components: {
			changeOrgs
		},
		methods: {
			listData(arr, orgId) {
				this.qingList = arr
				this.orgId = orgId
			},
			showModel(index) {
				if (index == this.showAcount) {
					this.showAcount = -1
				}else{
					this.showAcount = index
				}
			},
			scroll() {
			},
			upper() {},
			lower() {},
			jiebang(item) {
				console.log(item)
				if(this.name == '人脸采集') {
					uni.navigateTo({
						url: '../me/fixPortrait?orgId='+item.orgId+'&empId='+item.empId + '&empName=' + item.empName
					})
				} else if(this.name == '消费记录') {
					uni.navigateTo({
						url: '/pagePayment/recode/xf_list?orgId='+item.orgId+'&empId='+item.empId
					})
				} else if(this.name == '学生轨迹') {
					uni.navigateTo({
						url: './guiji?orgId='+item.orgId+'&empId='+item.empId + '&empName=' + item.empName
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		overflow: hidden;
	}
	.stu_dangan {
		background-color: rgb(243, 243, 243);
		height: 100vh;
		overflow: hidden;
		.m_header {
			width: 100vw;
			height: 390rpx;
			background-image: url('');
			background-size: 100%;
			background-repeat: no-repeat;
			display: flex;
			justify-content: center;
		}
		.stu_content {
			padding: 0 30rpx 20rpx 30rpx;
			width: 92%; 
			position: absolute;
			top: 230rpx;
			.my_box1 {
				box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.09);
				border-radius: 8rpx;
				display: flex;
				flex-direction: column;
				background-color: #FFFFFF;
				margin-top: 20rpx;
				padding: 30rpx 30rpx 20rpx 30rpx;
				.j_b_box {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-bottom: 20rpx;
					.m_title {
						font-family: "PingFangSC-Heavy, PingFang SC";
						font-weight: 600;
						font-size: 34rpx;
						color: #3C424F;
					}
					.jiebang {
						padding: 8rpx 20rpx;
						border-radius: 40rpx;
						color: #185AFF;
						display: flex;
						justify-content: center;
						align-items: center;
						border: 1px solid #185AFF;
						font-size: 28rpx;
					}
				}
				.m_info {
					display: flex;
					flex-direction: column;
					.m_txt1 {
						font-size: 28rpx;
					}
					.m_txt {
						font-family: "PingFangSC-Medium, PingFang SC";
						font-weight: 500;
						font-size: 26rpx;
						color: #6B707A;
						line-height: 50rpx;
					}
				}
			}
		}
	}
</style>